<template>
  <div v-show="isShow" class="mesage-box">
    {{ message }}
  </div>
</template>

<script>
export default {
  name: 'MesageBox',
  props: {
    message: {
      type: String,
      default: ''
    }
  },
  data () {
    return {
      isShow: false
    }
  },
  methods: {
    show (message) {
      this.message = message
      this.isShow = true
      setTimeout(() => {
        this.isShow = false
      }, 3000)
    },
    hide () {}
  }
}
</script>

<style lang="scss" scoped>
.mesage-box {
  opacity: 0.6;
  background: #333;
  border-radius: 10px;
  width: 170px;
  height: 50px;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  font-size: 16px;
  color: #fff;
  text-align: center;
  margin: auto;
  line-height: 50px;
  z-index: 9999;
}
</style>
